Framework = {}

if( true ) then -- Auto unref!
	local function GetVersion() 
		for k, v in pairs( file.Find( "../addons/*" ) ) do
			if( file.IsDir( "../addons/" .. v ) ) then
				if( file.Exists( "../addons/" .. v .. "/lua/Framework" ) ) then
					local Str = file.Read( "../addons/" .. v .. "/info.txt" )
					if( Str ) then
						Framework.Version = tonumber(Str:match( "version\"\t\"(%d+)\"" ))
						return
					end
				end
			end
		end
	end
	GetVersion()
end

function Framework.UpdateCheck( Callback )
	http.Get( "http://gmod-developer-framework.googlecode.com/svn/trunk/info.txt", "", function(s) Callback( tonumber(s:match( "version\"\t\"(%d+)\"" )) >= Framework.Version ) end )
end

function Framework.LoadLibraries( ... )
	for k, v in pairs( {...} ) do
		if( SERVER ) then
			AddCSLuaFile( "Subsystems/" .. v .. ".lua" )
		end
		include( "Subsystems/" .. v .. ".lua" )
	end
end